/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package menu;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Menu;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;
public class Welcome {
	JFrame w = new JFrame("managementsystem");
	JPanel p1 = new JPanel(); 
	JPanel p2 = new JPanel(); 
    JLabel l = new JLabel("欢迎进入学生信息管理系统！");
    JButton b = new JButton("确定");
    Welcome(){
    w.addWindowListener(new Wind());
    b.addMouseListener(new Monitor2());
    Font   font   =   new   Font( "欢迎进入学生信息管理系统！",   Font.PLAIN,   40); 
    l.setFont(font);
    w.add(p1,BorderLayout.CENTER);
    w.add(p2,BorderLayout.SOUTH);
    p1.add(l);
    l.setBounds(p1.WIDTH/2-100,p1.HEIGHT/2-10,200,20);    
    p2.add(b);
    b.setBounds(p2.WIDTH/2-10,p2.HEIGHT/2-6,20,12);
    
	w.setBounds(400, 200, 600, 200);
	w.setVisible(true);
    }
    private class Monitor2 extends MouseAdapter{
    	public void mousePressed(MouseEvent e) {
    		new Menu();
    		w.setVisible(false);
    	}
    }

	public static void main(String args[]){
		new Welcome();
	}
	private class Wind extends WindowAdapter{
		public void windowClosing(WindowEvent e) {
			w.setVisible(false);
			System.exit(0);	
		}
	}
}
